import requests
import json
import base64
import urllib
from selenium import webdriver
import time


#selenium 截图
# driver = webdriver.Chrome()
# driver.get('https://www.dianxiaomi.com/index.htm')
#time.sleep(1)

str=''
with open('./elements.json','r',encoding='utf-8') as f:
    listCookies=json.loads(f.read())
cookie = [item["name"] + "=" + item["value"] for item in listCookies]
cookiestr = '; '.join(item for item in cookie)
print(listCookies)

driver = webdriver.Chrome()
driver.get('https://elements.envato.com/trudel-moving-business-html-template-5K4KSN')


for cookie in listCookies:
    if 'expiry' in cookie:
        del cookie['expiry']
    driver.add_cookie(cookie)

driver.get('https://elements.envato.com/trudel-moving-business-html-template-5K4KSN')